#include <stdio.h>

int sum(int * arr, int n);

int main(void) {
  int arr[3] = { 5, 6, 4 };
  int total = sum(arr, 3);

  printf("%d\n", total);

  return 0;
}

int sum(int * arr, int n) {
  int total = 0;
  for (int i = 0; i < n; i++) total += *(arr + i);
  return total;
}